package base.day19.array;

import base.day16.interface1.Inter;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListIterator {
    public static void main(String[] args) {
        List<String> list=new ArrayList<String>();
        list.add("a");
        list.add("b");
        list.add("c");
        list.add("d");
        list.add("e");

        Iterator<String> it=list.iterator();
        while (it.hasNext()){
            String s=it.next();
            System.out.println(s);
        }
        for (String s : list) {
            System.out.println(s);
        }
    }
}
